﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Site1.Master" AutoEventWireup="true" CodeBehind="Enquiries.aspx.cs" Inherits="gamexpert.admin.Enquiries" Theme="Admin" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h2>Enquiries</h2>
<div class="submenu">
    <ul><li><asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Download all enquiries</asp:LinkButton></li></ul>
</div>
<div>
    <p>This is the list of enquiries. If you want to download all the enquiries in CSV file format please click the above link.</p>
</div>
<div class="content">
 <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
        BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
        DataKeyNames="id" DataSourceID="SqlDataSource1" ForeColor="Black" 
        GridLines="Vertical" onselectedindexchanged="GridView1_SelectedIndexChanged">
        <RowStyle BackColor="#F7F7DE" />
        <Columns>
            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                ReadOnly="True" SortExpression="id" />
            <asp:BoundField DataField="name" HeaderText="name" SortExpression="name" />
            <asp:BoundField DataField="firstname" HeaderText="firstname" 
                SortExpression="firstname" />
            <asp:BoundField DataField="lastname" HeaderText="lastname" 
                SortExpression="lastname" />
            <asp:BoundField DataField="email" HeaderText="email" SortExpression="email" />
            <asp:BoundField DataField="enquiry" HeaderText="enquiry" 
                SortExpression="enquiry" />
            <asp:BoundField DataField="createdon" HeaderText="createdon" 
                SortExpression="createdon" />
            <asp:CommandField ShowDeleteButton="True" 
                ShowSelectButton="True" ShowEditButton="True" />
        </Columns>
        <FooterStyle BackColor="#CCCC99" />
        <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:gamexpertConnectionString %>" 
        DeleteCommand="DELETE FROM [my_enquiry] WHERE [id] = @original_id" 
        InsertCommand="INSERT INTO [my_enquiry] ([firstname], [lastname], [email], [enquiry], [createdon], [name]) VALUES (@firstname, @lastname, @email, @enquiry, @createdon, @name)" 
        OldValuesParameterFormatString="original_{0}" 
        SelectCommand="SELECT * FROM [my_enquiry]" 
        UpdateCommand="UPDATE [my_enquiry] SET [firstname] = @firstname, [lastname] = @lastname, [email] = @email, [enquiry] = @enquiry, [createdon] = @createdon, [name] = @name WHERE [id] = @original_id">
        <DeleteParameters>
            <asp:Parameter Name="original_id" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="firstname" Type="String" />
            <asp:Parameter Name="lastname" Type="String" />
            <asp:Parameter Name="email" Type="String" />
            <asp:Parameter Name="enquiry" Type="String" />
            <asp:Parameter Name="createdon" Type="DateTime" />
            <asp:Parameter Name="name" Type="String" />
            <asp:Parameter Name="original_id" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="firstname" Type="String" />
            <asp:Parameter Name="lastname" Type="String" />
            <asp:Parameter Name="email" Type="String" />
            <asp:Parameter Name="enquiry" Type="String" />
            <asp:Parameter Name="createdon" Type="DateTime" />
            <asp:Parameter Name="name" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    

   
</div>
    
    
</asp:Content>
